<?php
require("config.php");

// 1. Create a database connection
$connection = mysql_connect("localhost","test","qwerty");
if (!$connection) {
	die("Database connection failed: " . mysql_error());
}

mysql_query("SET character_set_results=utf8", $connection);
mysql_query("SET NAMES 'utf8', $connection");
	mb_language('uni');
	mb_internal_encoding('UTF-8');
	
// 2. Select a database to use 
$db_select = mysql_select_db("test",$connection);
mysql_query("DEFAULT CHARACTER SET utf8");
mysql_query("COLLATE utf8_lithuanian_ci"); 
mysql_query("SET NAMES utf8"); 
// echo ">>".$connection."<<";
if (!$db_select) {
	die("Database selection failed: " . mysql_error());
}
?>
